package com.example.dao.impl;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.database.Cursor;

import com.example.dao.LearnDao;
import com.example.db.DBHelper;
import com.example.model.LEARN;

public class LearnDaoImpl implements LearnDao{

	String table = "Learn";

	@Override
	public List<LEARN> getList(Context context) {
		List<LEARN> list = new ArrayList<LEARN>();
		String sql = "select name from "+table;
		Cursor cursor = DBHelper.getDB(context).rawQuery(sql, null);
		while(cursor.moveToNext()){
			LEARN learn = new LEARN();
			learn.setName(cursor.getString(cursor.getColumnIndex("name")));
			list.add(learn);
			
		}
		return list;
	}
	
	
}
